The erection mechanisms have as starting point a nervous centre located in the spinal cord (backbone). The brain has a modulating effect on the erection nervous centres. The fibres which innervate the penis come down the small pelvis and run along the edges of the seminal vesicles and the prostate (the cavernous nerves), then the membranous urethra. The cavernous nerves terminal branches innervate the cavernous bodies arteries and the smooth muscular fibres, thus controlling the penis tumescence (filling) and detumescence (coming back to the normal state).
The penis contains 3 structures allowing the erection because they contain erectile tissue: 2 cavernous bodies which are parallel cylinders located at the centre of the penis and the spongy body containing the urethra and which constitutes the essential of the glans. The erectile tissue is made of blood vessels rather loosely organized and surrounded by smooth muscular fibres. At rest, the penis is flaccid and the arrival of the blood in the cavernous body is reduced to the minimum because the blood vessels are contracted. When an erection occurs, the sexual excitation releases a nervous signal which carries the relaxation of the smooth muscle present around the blood vessels of the erectile tissue. The blood may then fill and dilate such vessels which are placed under pressure within the rigid wall of the cavernous bodies (the two cavernous bodies are surrounded by the albugineous tunique, a tough and not distensible wall). The veins prevent that the blood flows out which carries putting the penis under tension and in erection state. The stiffness of the erection depends then on the artery contribution and the effectiveness of the venous occlusion within the cavernous bodies. The detumescence occurs when the cavernous bodies venous drainage is re-established (new contraction by nervous stimulation).
The bulbo-cavernous and ischio-cavernous muscles assure, when being contracted an increase of the intra-cavernous pressure and therefore, the erection.
Three phenomena successively occur then:                the erectile tissue relaxation;        the vasodilatation and the increase of the arterial flow;        the blockade of the venous return under the albuginous tunique.        